/*! _tabs.scss | Vuero | Css ninja 2020-2021 */

/*
    1. Tabs
    2. Tabs Dark mode
    3. Tab Content
    4. Sliding tabs 2X
    5. Sliding tabs 3X
    6. Sliding tabs Dark mode
*/

/* ==========================================================================
1. Tabs
========================================================================== */

.tabs {
  margin-bottom: 20px;

  &.is-toggle {
    li {
      &:first-child {
        a {
          border-right: none;
        }
      }

      &:last-child {
        a {
          border-left: none;
        }
      }

      &.is-active {
        a {
          background: var(--primary);
          border-color: var(--primary);

          &:hover {
            color: var(--white);
          }
        }
      }

      a {
        transition: all 0.3s;

        &:hover {
          border-color: #dbdbdb;
        }
      }
    }
  }

  li {
    &.is-active {
      a {
        border-bottom-color: var(--primary);
        color: var(--primary);

        &:hover {
          border-bottom-color: var(--primary);
          color: var(--primary);
        }
      }
    }

    a {
      font-family: var(--font);
      border-bottom-width: 2px;
      color: var(--placeholder);
      border-bottom-color: transparent;

      &:hover {
        color: var(--light-text);
        border-bottom-color: transparent;
      }

      svg {
        height: 16px;
        width: 16px;
        margin-right: 6px;
      }

      .fas,
      .fal,
      .far,
      .fad,
      .fab {
        margin-right: 6px;
      }

      .lnil,
      .lnir {
        font-size: 20px;
        margin-right: 6px;
      }

      small {
        margin-left: 5px;
      }
    }
  }
}

/* ==========================================================================
2. Tabs Dark mode
========================================================================== */

.is-dark {
  .tabs {
    &.is-boxed {
      li {
        &.is-active {
          a,
          a:hover {
            background: var(--dark-sidebar-light-1) !important;
          }
        }

        a {
          border-color: var(--dark-sidebar-light-16) !important;

          &:hover {
            background: var(--dark-sidebar-light-4) !important;
          }
        }
      }
    }

    &.is-toggle {
      li {
        &.is-active {
          a,
          a:hover {
            background: var(--primary) !important;
            border-color: var(--primary);
            color: var(--white);
          }
        }

        a {
          border-color: var(--dark-sidebar-light-16) !important;

          &:hover {
            background: var(--dark-sidebar-light-4) !important;
          }
        }
      }
    }

    ul {
      border-bottom-color: var(--dark-sidebar-light-16);
    }

    li {
      &.is-active {
        a {
          border-bottom-color: var(--primary);
          color: var(--primary);
        }
      }
    }
  }
}

/* ==========================================================================
3. Tab Content
========================================================================== */

.tab-content {
  display: none;
  animation-name: fadeInLeft;
  animation-duration: 0.5s;

  &.is-active {
    display: block;

    &.is-spaced {
      margin-top: 10px !important;
    }
  }

  &.is-spaced {
    margin-top: 40px;
  }

  &.is-spaced-lg {
    margin-top: 40px !important;
  }
}

/* ==========================================================================
4. Sliding tabs 2X
========================================================================== */

.tabs-wrapper,
.tabs-wrapper-alt {
  &.is-slider {
    &.is-inverted {
      .tabs {
        background: var(--white);
      }
    }

    &.is-squared {
      .tabs,
      .tab-naver {
        border-radius: 8px;
      }
    }

    .tabs {
      position: relative;
      background: var(--fade-grey-light-2);
      border: 1px solid var(--fade-grey);
      max-width: 185px;
      height: 35px;
      border-bottom: none;
      border-radius: 500px;

      ul {
        border-bottom: none;

        &.is-profile {
          li {
            a {
              color: var(--smoke-white) !important;
            }

            &.is-active a {
              color: var(--dark-text) !important;
            }
          }
        }
      }

      li {
        width: 50%;

        a {
          color: var(--light-text);
          font-family: var(--font);
          height: 40px;
          border-bottom: none;
          position: relative;
          z-index: 5;

          span {
            position: relative;
            top: -1px;
            display: block;
          }
        }

        &.is-active a {
          color: var(--white);
          font-weight: 400;
        }

        &:first-child {
          &.is-active ~ .tab-naver {
            margin-left: 0;
          }
        }

        &:nth-child(2) {
          &.is-active ~ .tab-naver {
            margin-left: 50% !important;
          }
        }
      }
    }

    .tab-naver {
      left: 0;
      background: var(--primary);
      position: absolute;
      top: 0.5px;
      display: block;
      height: 32px;
      transition: all 0.3s;
      z-index: 4;
      border-radius: 50px;

      &.is-profile {
        background: var(--smoke-white) !important;
      }

      &.is-active {
        margin-left: 50%;
      }
    }
  }
}

/* ==========================================================================
5. Sliding tabs 3X
========================================================================== */

.tabs-wrapper,
.tabs-wrapper-alt {
  &.is-triple-slider {
    &.is-inverted {
      .tabs {
        background: var(--white);
      }
    }

    &.is-squared {
      .tabs,
      .tab-naver {
        border-radius: 8px;
      }
    }

    .tabs {
      position: relative;
      background: var(--fade-grey-light-2);
      border: 1px solid var(--fade-grey);
      max-width: 280px;
      height: 35px;
      border-bottom: none;
      border-radius: 500px;

      ul {
        border-bottom: none;

        &.is-profile {
          li {
            a {
              color: var(--smoke-white) !important;
            }

            &.is-active a {
              color: var(--dark-text) !important;
            }
          }
        }
      }

      li {
        width: 33.3%;

        a {
          color: var(--light-text);
          font-family: var(--font);
          font-weight: 400;
          height: 40px;
          border-bottom: none;
          position: relative;
          z-index: 5;

          span {
            position: relative;
            top: -1px;
            display: block;
          }
        }

        &.is-active a {
          color: var(--white);
          font-weight: 400;
        }

        &:first-child {
          &.is-active ~ .tab-naver {
            margin-left: 0;
          }
        }

        &:nth-child(2) {
          &.is-active ~ .tab-naver {
            margin-left: 33% !important;
          }
        }

        &:nth-child(3) {
          &.is-active ~ .tab-naver {
            margin-left: 66.6%;
          }
        }
      }
    }

    .tab-naver {
      position: absolute;
      top: 0.5px;
      left: 0;
      display: block;
      width: 33.3% !important;
      background: var(--primary);
      height: 32px;
      transition: all 0.3s;
      z-index: 4;
      border-radius: 50px;

      &.is-profile {
        background: var(--smoke-white) !important;
      }

      &.is-active {
        margin-left: 48%;
      }
    }
  }
}

/* ==========================================================================
6. Sliding tabs Dark mode
========================================================================== */

.is-dark {
  .tabs-wrapper {
    &.is-slider,
    &.is-triple-slider {
      &.is-inverted {
        .tabs {
          border: 1px solid var(--dark-sidebar-light-16) !important;
          background: var(--dark-sidebar-light-2) !important;
        }
      }

      .tabs {
        border: 1px solid var(--dark-sidebar-light-16) !important;
        background: var(--dark-sidebar-light-2) !important;

        .tab-naver {
          background: var(--primary) !important;
        }

        ul {
          border: none;
        }

        li {
          &.is-active {
            a {
              color: var(--white);
            }
          }
        }
      }
    }
  }
}

/* ==========================================================================
4. Vertical tabs
========================================================================== */

@media only screen and (max-width: 767px) {
  .vertical-tabs-wrapper {
    .tabs {
      ul {
        li {
          &.is-active {
            a {
              color: var(--primary);
              border-bottom-color: var(--primary);
            }
          }

          a {
            color: var(--light-text);
          }
        }
      }
    }

    .content-wrap {
      .tab-content {
        padding-top: 12px;
        display: none;
        animation: fadeInLeft 0.5s;

        &.is-active {
          display: block;
        }
      }
    }
  }
}

@media only screen and (min-width: 768px) {
  .vertical-tabs-wrapper {
    display: flex;

    .tabs {
      min-width: 25%;
      max-width: 25%;
      margin-right: 30px;

      ul {
        display: block;
        text-align: left;
        border-bottom-color: transparent !important;

        li {
          display: block;

          &.is-active {
            a {
              color: var(--primary);
              border-right-color: var(--primary);
            }
          }

          a {
            display: block;
            border-bottom-color: transparent !important;
            border-right: 2px solid #dbdbdb;
            color: var(--light-text);
          }
        }
      }
    }

    .content-wrap {
      flex-grow: 2;

      .tab-content {
        display: none;
        animation: fadeInLeft 0.5s;

        &.is-active {
          display: block;
        }
      }
    }
  }
}
